import React from 'react';
import { Spin } from 'antd';

// loading components from code split
// https://umijs.org/plugin/umi-plugin-react.html#dynamicimport
export default class PageLoading extends React.Component {

  componentDidMount() {
    if ('undefined' !== typeof NProgress) {
      NProgress.start();
      NProgress.set(0.3);
    }
  }

  componentWillUnmount() {
    if ('undefined' !== typeof NProgress) {
      NProgress.done();
    }
  }

  render() {
    return (
      <div style={{ paddingTop: 100, textAlign: 'center' }}>
        <Spin/>
      </div>
    );
  }
}
